package com.dotflat.fin.cnst;


public class APPConstants {

	public enum Member{
        REGISTER_MEMBER(0, "注册会员"), //注册会员

        YEAR_3_MEMBER(1, "包年会员"), //包年会员
        YEAR_2_MEMBER(2, "包年会员"),//包年会员
        YEAR_1_MEMBER(3, "包年会员"),//包年会员

        MONTH_MEMBER(4, "包月会员"), //包月会员

        TIMES_MEMBER(5, "计次会员"); //计次会员


        public static Member forValue(int value) {
            switch (value) {
                case 0: return REGISTER_MEMBER;
                case 1: return YEAR_3_MEMBER;
                case 2: return YEAR_2_MEMBER;
                case 3: return YEAR_1_MEMBER;
                case 4: return MONTH_MEMBER;
                case 5: return TIMES_MEMBER;
                default: return REGISTER_MEMBER;
            }
        }

	    private int value ;
	    private String desc;

	    private Member(int value, String desc){
	        this.value = value;
	        this.desc = desc;
	    }

        public int getValue() {
            return this.value;
        }

        public String getDesc(){return this.desc;}
	}

    public enum PromoCodeType{
        Percent(0), //未发放
        Total(1); //发放成功
        private int value ;
        private PromoCodeType(int value){
            this.value = value;
        }

        public int getValue() {
            return this.value;
        }

        public static PromoCodeType forValue(int value) {
            switch (value) {
                case 0: return Percent;
                case 1: return Total;

                default: return Percent;
            }
        }
    }

    public enum ProductIssueStatus{
        ISSUE_NON(0), //未发放
        ISSUE_SUCCESS(1); //发放成功
        private int value ;
        private ProductIssueStatus(int value){
            this.value = value;
        }

        public int getValue() {
            return this.value;
        }

        public static ProductIssueStatus forValue(int value) {
            switch (value) {
                case 0: return ISSUE_NON;
                case 1: return ISSUE_SUCCESS;

                default: return ISSUE_NON;
            }
        }
    }
	
	public enum Status{
	    NOT_ONLINE(0) ,//未上线
	    NOW_ONLINE(1),//已上线
	    TIME_ONLINE(2),//定时上线
	    PRE_ONLINE(98),//预发布
	    OFFLINE(99); //已下线
	    
	    private int value ;
        private Status(int value){
            this.value = value;
        }
        
        public int getValue(){
            return this.value;
        }
	}

	
	
	public enum PayOrderStatus{
	    
	    NON_PAYMENT(0),
        PAY_SUCCESS(1),
        ORDER_FINISHED(2),
        
        PAY_FAILED(98),
        ORDER_CANCEL(99);
        
        private int value ;
        PayOrderStatus(int value){
            this.value = value;
        }
        
        public int getValue(){
            return this.value;
        }
    }
	
	public enum PayType{
	    ALIPAY(1,"alipay"),
	    WXPAY(2,"wxpay"),
	    APPLEPAY(3,"applepay"),
	    HWPAY(4,"hwpay"),
	    DANGBEIPAY(6,"dangbeipay"),
	    XIAOMIPAY(7,"xiaomipay"),
        DAMAIPAY(8,"damaipay"),
        HISENSEPAY(9,"hisensepay"),
        LEPAY(10,"lepay"),
        HWPAY_SIGN(11,"hwpay_sign"),
        OPPOPAY(12,"oppopay"),

        BOOK_SHARE(998,"book_share"),
        CDKEY(999,"cdkey");
	    
	    private int value;
	    private String name;
	    
	    PayType(int value , String name){
	        this.value = value;
	        this.name = name;
	    }
	    
	    public int getValue(){
	        return this.value;
	    }
	    
	    public String getName(){
	        return this.name;
	    }
	    
	    public static PayType forNumber(int value) {
	        switch (value) {
	          case 1: return ALIPAY;
	          case 2: return WXPAY;
	          case 3: return APPLEPAY;
	          case 4: return HWPAY;
	          case 6: return DANGBEIPAY;
	          case 7: return XIAOMIPAY;
	          case 8: return DAMAIPAY;
              case 9: return HISENSEPAY;
              case 10: return LEPAY;
              case 11: return HWPAY_SIGN;
              case 12: return OPPOPAY;
              case 999:return CDKEY;
	          default: return null;
	        }
	    }
	}
	
	public enum ProductType{
        
        TIMES(1),
        DURATIONS(2);

        private int value ;
        private ProductType(int value){
            this.value = value;
        }
        
        public int getValue(){
            return this.value;
        }
        
        public static ProductType forNumber(int value) {
            switch (value) {
              case 1: return TIMES;
              case 2: return DURATIONS;
//              case 3: return Album;
//              case 4: return Tag;
              default: return null;
            }
        }
    }
	
	public enum PackageType{
	    //类型 0-订阅 1-首次购买 2-首次续费 3-普通续费 11-B端会员 12-点播图书包 99-体验
	    SUBSCRIPTION(0),
	    FIRSTORDER(1),
	    FIRSTRENEW(2),
	    RENEW(3),
	    TOBVIP(11),
	    BOOKPACKAGE(12),
        
	    TRIAL(99);//体验会员
        private int value ;
        
        private PackageType(int value){
            this.value = value;
        }
        
        public int getValue(){
            return this.value;
        }
        
        public static PackageType forNumber(int value) {
            switch (value) {
              case 0: return SUBSCRIPTION;
              case 1: return FIRSTORDER;
              case 2: return FIRSTRENEW;
              case 3: return RENEW;
              case 11: return TOBVIP;
              case 12: return BOOKPACKAGE;
              case 99: return TRIAL;
              default: return null;
            }
        }
    }
	
	public enum AccountType{
        
        PHONE(1),
        WECHAT(2),
        QQ(3),
        EMAIL(4),
        GUEST(5),
        HUAWEI(6),
        ALIZFB(7);
        private int value ;
        private AccountType(int value){
            this.value = value;
        }
        
        public int getValue(){
            return this.value;
        }
        
        public static AccountType forNumber(int value) {
            switch (value) {
              case 1: return PHONE;
              case 2: return WECHAT;
              case 3: return QQ;
              case 4: return EMAIL;
              case 5: throw new IllegalArgumentException("AccountType不应该为GUEST");
              case 6: return HUAWEI;
              case 7: return ALIZFB;
              default: throw new IllegalArgumentException("AccountType无法识别");
            }
        }
    }


    public final static int PARENT_PAY_REPORT_PRODUCT_ID = 100;
    public final static String PRODUCT_ID_KEY = "p";
    public final static String PAY_OBJECT_TYPE_KEY = "o";
    public final static String PAY_OBJECT_ID_KEY = "i";
    public final static String USER_ID = "u";

	public enum PayObjectType{
        
        VIP(0),
        REPORT(1),
        OTHER(2);
        
        private int value ;
        private PayObjectType(int value){
            this.value = value;
        }
        
        public int getValue(){
            return this.value;
        }
        
        public static PayObjectType forValue(int value) {
            switch (value) {
              case 0: return VIP;
              case 1: return REPORT;
              case 2: return OTHER;
              default: return null;
            }
        }
    }

    public enum TagRelObjectType{
        //对象类型， 1.question  2. storeItem   3.dimension   4.newsItem
        NONE(0),
        QUESTION(1),
        STOREITEM(2),
        DIMENSION(3),
        NEWSITEM(4);

        private int value ;
        private TagRelObjectType(int value){
            this.value = value;
        }

        public int getValue(){
            return this.value;
        }

        public static TagRelObjectType forValue(int value) {
            switch (value) {
                case 0: return NONE;
                case 1: return QUESTION;
                case 2: return STOREITEM;
                case 3: return DIMENSION;
                case 4: return NEWSITEM;
                default: return null;
            }
        }
    }

    public enum TradeTypeWX{

        JSAPI("JSAPI" , 1), //公众号页面
        NATIVE("NATIVE" ,2), //原生扫码支付
        APP("APP" ,3); //APP


        private int value ;
        private String name;
        private TradeTypeWX(String name ,int value){
            this.value = value;
            this.name = name;
        }

        public int getValue(){
            return this.value;
        }
        public String getName(){
            return this.name;
        }
    }

}
